<?php 
namespace app\superadmin\controller;
use think\Db;
use think\Controller;
use think\Session;
class Password extends Base{
	public function index(){

		return $this->fetch();
	}
	public function doupdatepassword(){
		// $data=input("post.");
		$adminid=input("adminid");
		$adminname=input("adminname");
		$password=input("password");
		$res=Db::name('admins')->where('adminid',$adminid)->update(['adminname'=>$adminname,'password'=>md5($password)]);
		if ($res) {
			# code...
			echo "修改成功，请重新登陆";
			Session::clear();
			// $this->redirect('Index/index');
		}else{
			echo "修改失败";
		}
	}
}